home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFData.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  2.9 KB  |  138 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFData.h
  3.  
  4.      Contains:    CoreFoundation block of bytes
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFDATA__
  18. #define __COREFOUNDATION_CFDATA__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. typedef const struct __CFData * CFDataRef;
  48. typedef struct __CFData * CFMutableDataRef;
  49. EXTERN_API_C( CFTypeID )
  50. CFDataGetTypeID                    (void);
  51.  
  52.  
  53. EXTERN_API_C( CFDataRef )
  54. CFDataCreate                    (CFAllocatorRef         allocator,
  55.                                  const UInt8 *            bytes,
  56.                                  CFIndex                 length);
  57.  
  58. EXTERN_API_C( CFDataRef )
  59. CFDataCreateWithBytesNoCopy        (CFAllocatorRef         allocator,
  60.                                  const UInt8 *            bytes,
  61.                                  CFIndex                 length,
  62.                                  CFAllocatorRef         bytesDeallocator);
  63.  
  64. /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */
  65. EXTERN_API_C( CFDataRef )
  66. CFDataCreateCopy                (CFAllocatorRef         allocator,
  67.                                  CFDataRef                 data);
  68.  
  69. EXTERN_API_C( CFMutableDataRef )
  70. CFDataCreateMutable                (CFAllocatorRef         allocator,
  71.                                  CFIndex                 capacity);
  72.  
  73. EXTERN_API_C( CFMutableDataRef )
  74. CFDataCreateMutableCopy            (CFAllocatorRef         allocator,
  75.                                  CFIndex                 capacity,
  76.                                  CFDataRef                 data);
  77.  
  78.  
  79. EXTERN_API_C( CFIndex )
  80. CFDataGetLength                    (CFDataRef                 data);
  81.  
  82. EXTERN_API_C( const UInt8 *)
  83. CFDataGetBytePtr                (CFDataRef                 data);
  84.  
  85. EXTERN_API_C( UInt8 *)
  86. CFDataGetMutableBytePtr            (CFMutableDataRef         data);
  87.  
  88. EXTERN_API_C( void )
  89. CFDataGetBytes                    (CFDataRef                 data,
  90.                                  CFRange                 range,
  91.                                  UInt8 *                buffer);
  92.  
  93.  
  94. EXTERN_API_C( void )
  95. CFDataSetLength                    (CFMutableDataRef         data,
  96.                                  CFIndex                 length);
  97.  
  98. EXTERN_API_C( void )
  99. CFDataIncreaseLength            (CFMutableDataRef         data,
  100.                                  CFIndex                 extraLength);
  101.  
  102. EXTERN_API_C( void )
  103. CFDataAppendBytes                (CFMutableDataRef         data,
  104.                                  const UInt8 *            bytes,
  105.                                  CFIndex                 length);
  106.  
  107. EXTERN_API_C( void )
  108. CFDataReplaceBytes                (CFMutableDataRef         data,
  109.                                  CFRange                 range,
  110.                                  const UInt8 *            newBytes,
  111.                                  CFIndex                 newLength);
  112.  
  113. EXTERN_API_C( void )
  114. CFDataDeleteBytes                (CFMutableDataRef         data,
  115.                                  CFRange                 range);
  116.  
  117.  
  118. #if PRAGMA_STRUCT_ALIGN
  119.     #pragma options align=reset
  120. #elif PRAGMA_STRUCT_PACKPUSH
  121.     #pragma pack(pop)
  122. #elif PRAGMA_STRUCT_PACK
  123.     #pragma pack()
  124. #endif
  125.  
  126. #ifdef PRAGMA_IMPORT_OFF
  127. #pragma import off
  128. #elif PRAGMA_IMPORT
  129. #pragma import reset
  130. #endif
  131.  
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif /* __COREFOUNDATION_CFDATA__ */
  137.  
  138.